import { createSlice } from '@reduxjs/toolkit';

// 定义 slice state 的类型
interface TabbarState {
  value: boolean;
}

// 使用该类型定义初始 state
const initialState: TabbarState = {
  value: true,
};

const tabbarSlice = createSlice({
  name: 'tabbar',
  initialState,
  reducers: {
    show(state) {
      state.value = true;
    },
    hide(state) {
      state.value = false;
    },
  },
});

export const { show, hide } = tabbarSlice.actions;
export default tabbarSlice.reducer;
